package com.me.chat.mapper.chat;

import com.me.chat.pojo.chat.ChatLately;
import com.me.chat.pojo.chat.qo.ChatLatelyQO;

import java.util.List;

/**
 * 最近联系人
 * @Author: qiu
 * @Date: 2021/11/23 20:18
 */

public interface ChatLatelyMapper {

    //查出最近联系人
    List<ChatLately> selChatLately(String userId);

    /**
     * 最近联系人入库
     * @param chatLatelyQO
     */
    void addChatLately(ChatLatelyQO chatLatelyQO);

    /**
     * 更新最近联系人到消息、未读数量，以及更新时间
     * @param chatLatelyQO
     */
    void upLatelyByCondition(ChatLatelyQO chatLatelyQO);

    /**
     * 根据消息内容判断该用户是否已经有这个最近联系人
     * @param chatLatelyQO
     * @return
     */
    ChatLately selChatLatelyByCondition(ChatLatelyQO chatLatelyQO);

    /**
     * 删除最近联系人
     * @param chatLatelyQO
     */
    void delChatLately(ChatLatelyQO chatLatelyQO);

}
